import React from 'react';
import { Result } from 'antd';
import Confirm from './Confirm';
import Accept from './Accept';
import ConfirmReject from './ConfirmReject';
import Reject from './Reject';
import './index.less';

const ExpirePage = ({ offerEffectiveValue }) => (
    <Result status="error" title={`超过${offerEffectiveValue}小时未确认，链接已失效！`} />
);

export default props => {
    const componentMap = {
        accept: Accept,
        reject: Reject,
        confirmReject: ConfirmReject,
        expire: ExpirePage
    };

    const Page = componentMap[props.status] ?? Confirm;
    return <Page {...props} />;
};
